// owner-app/pages/gover-serve/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    links: [
      {
        name: "公安服务",
        imgUrl: "../../static/icon/government_police.png",
        httpUrl: "https://police.xa.gov.cn/xawsbs/weixin/index.jsp",
      },
      {
        name: "交警服务",
        imgUrl: "../../static/icon/government_traffic.png",
        httpUrl: "https://www.xianjiaojing.com/art/gongge/type/yewu/key/ywbl",
      },
      {
        name: "消防服务",
        imgUrl: "../../static/icon/government_fire.png",
        httpUrl:
          "https://h5.bjue.cn/app/index.php?i=266&c=entry&eid=1263&wxref=mp.weixin.qq.com#wechat_redirect",
      },
      {
        name: "民政服务",
        imgUrl: "../../static/icon/government_service.png",
        httpUrl: "https://www.xa.gov.cn/",
      },
    ],
    autoplay: true,
    interval: 3000,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {},

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {},
  handlerGobackClick() {
    wx.switchTab({
      url: "/pages/home/index",
    });
  },
  clickItem(e) {
    let urls = encodeURIComponent(e.target.dataset.url);
    wx.navigateTo({
      url: `/owner-app/pages/links/index?url=${urls}`,
    });
  },
});
